<style>
    .checkoutform .panel{box-shadow:none;}
	.tab-pane .row > label{line-height: 38px;}
    .radio{padding-left:0px !important;}
	.selectlist{margin:0; padding:0;}
	.selectlist ul{padding:0}
	.selectlist li{list-style-type:none; margin:0; padding:0;padding:5px; border-bottom:1px solid #eee; margin:0 8px;}
	.selectlist li:hover{background:#eee;}
    .heading-custom{ border-left:1px solid #ddd; border-bottom:1px solid #ddd; margin-bottom:15px;}
    .heading-custom .nav .active{ border-top:2px solid #65CEA7; border-bottom:1px solid #fff;}
    .heading-custom .nav li{ border-top:1px solid #ddd; border-right:1px solid #ddd; height:auto; min-width:82px; text-align:center;}
    .tbpd{padding-top:5px;padding-bottom:5px}
    .lh34{line-height:34px;text-align:right}
    .lrpd{padding-left:0;padding-right:0}
    #member_position .alert{margin:5px;}
</style>
<form role="form" method="post" action="{:U('update')}" class="checkoutform" style="height:1000px; background:#fff;" id="editemployee"  onMouseMove="$(this).css({height:'auto'});">
    <input type="hidden" name="id" value="{$info.id}">
    <section class="panel" style="box-shadow:none">
        <header class="panel-heading heading-custom">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#home2" data-toggle="tab">
                        基本信息
                    </a></li>
                <li class=""><a href="#about2" data-toggle="tab">
                        详细资料
                    </a></li>
                <li class=""><a href="#about3" data-toggle="tab" >
                        权限分配
                    </a></li>
            </ul>
        </header>
        <div class="panel-body">
            <div class="tab-content">
                <div class="tab-pane active" id="home2">
                    <div class="row tbpd">
                        <div class="col-lg-6">
                            <label class="col-sm-2 text-muted lh34 lrpd" style="width:100px!important;text-align:right;padding-right:15px">姓名：</label>
                            <div class="col-sm-4">
                                <div class="text-input">
                                    <input name="name" class="form-control" id="name" type="text" placeholder="姓名" datatype="*"  nullmsg="姓名不能为空" errormsg="输入限制为文本" value="{$info.name}"/>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <label class="col-sm-2 text-muted lh34 lrpd" style="width:100px!important;text-align:right;padding-right:15px">性别：</label>
                            <div class="col-sm-4 icheck">
                                <div style="display:inline-block;">
                                    <div class="square-red single-row ">
                                        <input type="radio" value="1"
                                        <eq name="info['sex']" value="1"> checked</eq>
                                        name="sex">
                                        <label>男</label>
                                    </div>
                                </div>
                                <div style="display:inline-block;">
                                    <div class="square-red single-row ">
                                        <input type="radio" value="0"
                                        <eq name="info['sex']" value="0"> checked</eq>
                                        name="sex">
                                        <label>女</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row tbpd">
                        <div class="col-lg-6">
                            <label class="col-sm-2 text-muted lh34 lrpd" style="width:100px!important;text-align:right;padding-right:15px">电话：</label>
                            <div class="col-sm-4">
                                <div class=" text-input">
                                    <input name="tel" class="form-control" datatype="m" placeholder="电话" id="tel" type="text" value="{$info.tel}"/>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <label class="col-sm-2 text-muted lh34 lrpd" style="width:100px!important;text-align:right;padding-right:15px">邮箱：</label>
                            <div class="col-sm-4">
                                <div class="text-input">
                                    <!--此处不准删,防止自动填充 start-->
                                    <input type="text" style="width:0;height:0;float:left;visibility:hidden"/>
                                    <!--此处不准删,防止自动填充 end-->
                                    <input class="form-control" autocomplete="off" datatype="/^\s*$/|e" id="Email" name="Email" placeholder="邮箱" value="{$info.Email}" type="text">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row tbpd">
                        <div class="col-lg-6">
                            <label class="col-sm-2 text-muted lh34 lrpd" style="width:100px!important;text-align:right;padding-right:15px">密码：</label>
                            <div class="col-sm-4">
                                <div class=" text-input">
                                    <!--此处不准删,防止自动填充 start-->
                                    <input type="text" style="width:0;height:0;float:left;visibility:hidden"/>
                                    <!--此处不准删,防止自动填充 end-->
                                    <input class="form-control inputxt" type="password" placeholder="密码" name="password" id="password" ignore="ignore" datatype="*6-18"  nullmsg="密码不能为空" errormsg="不支持特殊字符"  autocomplete="off"  />
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <label class="col-sm-2 text-muted lh34 lrpd" style="width:100px!important;text-align:right;padding-right:15px">工号：</label>
                            <div class="col-sm-4">
                                <div class="text-input">
                                    <input class="form-control" datatype="*" id="company_id" name="company_id" placeholder="工号" value="{$info.company_id}" type="text">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row tbpd">
                        <div class="col-lg-6">
                            <label class="col-sm-2 text-muted lh34 lrpd" style="width:100px!important;text-align:right;padding-right:15px">状态：</label>
                            <div class="col-sm-4">
                                <div class=" text-input">
                                    <select class="form-control m-bot15" name="sta">
                                        <option value="1" <?php echo $info['status']=='1' ? 'selected' : ''; ?>>正常</option>
                                        <option value="0" <?php echo $info['status']=='0' ? 'selected' : ''; ?>>离职</option>
                                        <option value="2" <?php echo $info['status']=='2' ? 'selected' : ''; ?>>请假</option>
                                        <option value="3" <?php echo $info['status']=='3' ? 'selected' : ''; ?>>旷工</option>
                                        <option value="4" <?php echo $info['status']=='4' ? 'selected' : ''; ?>>出差</option>
                                        <option value="-1" <?php echo $info['status']=='-1' ? 'selected' : ''; ?>>禁用</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <label class=" col-sm-2 text-muted lh34 lrpd" style="width:100px!important;text-align:right;padding-right:15px">入职时间：</label>
                            <div class="col-sm-4">
                                <div class=" text-input">
                                    <input placeholder="入职时间" style="cursor:pointer;background:#fff;" value="{:date('Y-m-d',$info['reg_time'])}"  datatype="*" type="text" readonly class=" form-control datepicker input-none" name="reg_time" id="reg_time">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="panel" style="box-shadow:none;">
                            <header class="panel-heading"> 选择部门</header>
                            <div class="panel-body" id="selpart">
                                <div class="row tbpd">
                                    <div class="col-lg-6">
                                        <label class="col-sm-2 text-muted lh34 lrpd" style="width:100px!important;text-align:right;padding-right:15px">部门选择：</label>
                                        <div class="col-sm-4">
                                            <div id="member_position">
                                                {$hiddenid|default="<input type='hidden' name='member_position_id'>"}
                                            </div>
                                            <html:dropdownselect class="editselect mypart" listloaded="listlist" selected="" name="edit"  multi="0" style="height:auto;width:100%" action="{:U('Team/positionlist')}" title="选择部门" placeholder="点击选择部门"/>
                                            <div id="reselecteditlayout" style="top:0; display:none; left:0; bottom:0; right:0; position:fixed; z-index:9999999;"></div>
                                        </div>
                                    </div>
                                    <!--<div class="col-lg-6">-->
                                        <!--<label class="col-sm-2 text-muted lh34 lrpd" style="width:100px!important;text-align:right;padding-right:15px">部门主管：</label>-->
                                        <!--<div class="col-sm-4 icheck">-->
                                            <!--<div style="display:inline-block;">-->
                                            <!--<div class="square-red single-row">-->
                                                <!--<input type="radio" value="0" <eq name="info['isPositionAdmin']" value="0"> checked</eq> name="isPositionAdmin">-->
                                                <!--<label>否</label>-->
                                            <!--</div>-->
                                        <!--</div>-->
                                            <!--<div style="display:inline-block;">-->
                                                <!--<div class="square-red single-row">-->
                                                    <!--<input type="radio" value="1" <eq name="info['isPositionAdmin']" value="1"> checked</eq> name="isPositionAdmin">-->
                                                    <!--<label>是</label>-->
                                                <!--</div>-->
                                            <!--</div>-->
                                        <!--</div>-->
                                    <!--</div>-->
                                </div>
                            	<div class="row">
                                    <!--<if condition="$isadmin neq 1">-->
                                        <!--<div class="col-sm-6">-->
                                            <!--<html:dropdownselect typelimit="1" class="formMemberSelect" selected="{$info.pid}" listloaded="memberListLoaded" name="" style="height:auto; width:auto;" multi="0" action="{:U('Team/membergroup')}" title="选择员工" placeholder="点击选择上级" />-->
                                            <!--<div id="formReselectLayout" style="top:0; display:none; left:0; bottom:0; right:0; position:fixed; z-index:4999;"></div>-->
                                        <!--</div>-->
                                    <!--</if>-->
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="tab-pane" id="about2">
                    <div id="thisrow">{$info.newform}</div>
                    <!--<input type="hidden" name="newform" value="" id="newform">--><br/>
                    <a class="pull-right btn btn-success" href="javascript:void(0);" onClick="_openWindow('{:U('getNewform',['id'=>$info['id']])}',950,'修改资料','确定',null,'')" id="editbtn">点击修改资料</a>
                </div>
                <div class="tab-pane row" id="about3">
                    <div class="form-group <?php if($info['isadministrator'] == 1){?>hidden<?php }?>">
                        <div class="panel">
                            <header class="panel-heading"> 系统操作权限 </header>
                            <div class="panel-body">
                                <div class="member_role ">
                                    <volist name="role_list" id="vo">
                                        <?php $deep = $role_list[$key - 1]['cl']; if($deep != $vo['cl']){?>
                                        <?php }?>
                                        <div class="icheck" style="display:inline-block;">
                                            <div class="square-red single-row">
                                                <input <?php if($vo['id']==$info['group_id']):?>checked<?php endif; ?> type="radio" name="role_id[]" value="{$vo.id}" id="is_nav_2" />
                                                <label>{$vo.title}</label>
                                            </div>
                                        </div>
                                    </volist>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="panel">
                        <header class="panel-heading"> 积分分配权限 </header>
                        <div class="panel-body">
                            
                            <!-- 积分分配权限 --->
                            
                            <volist name="inteType" id="vo">
                                <if condition="$vo.typename neq Vinte">
                                <div class="form-group">
                                    <div class="row">
                                        <div class="col-lg-2 col-sm-3" style="padding:0">
                                            <div style="display: inline-block">分配{$vo.remark}：</div>
                                            <input type="text" style="display:inline-block;width:72px;" value="{$info['integralconfig'][$vo['typename']][0]|default='0'}" name="integralconfig[{$vo.typename}][]" class="form-control" placeholder="{$vo.remark}">
                                        </div>
                                        <div class="col-lg-2 col-sm-3" style="padding:0">
                                            <div style="display: inline-block">扣除{$vo.remark}：</div>
                                            <input type="text" style="display:inline-block;width:72px;" value="{$info['integralconfig'][$vo['typename']][1]|default='0'}" name="integralconfig[{$vo.typename}][]" class="form-control" placeholder="{$vo.remark}">
                                        </div>
                                        <div class="col-lg-2 col-sm-3" style="padding:0">
                                            <div style="display: inline-block">最高奖扣{$vo.remark}：</div>
                                            <input type="text" style="display:inline-block;width:72px;" value="{$info['integralconfig'][$vo['typename']][2]|default='0'}" name="integralconfig[{$vo.typename}][]" class="form-control" placeholder="{$vo.remark}">
                                        </div>
                                        <!--新增一个奖扣次数的配置，用于数据统计-->
                                        <div class="col-lg-2 col-sm-3" style="padding:0">
                                            <div style="display: inline-block">奖扣次数{$vo.remark}：</div>
                                            <input type="text" style="display:inline-block;width:72px;" value="{$info['integralconfig'][$vo['typename']][3]|default='0'}" name="integralconfig[{$vo.typename}][]" class="form-control" placeholder="{$vo.remark}次数">
                                        </div>
                                    </div>
                                </div>
                                    </if>
                            </volist>
                            <!-- 积分分配权限结束 -->
                        </div>
                    </div>
                    <div class="panel <?php if($info['isadministrator'] == 1){?>hidden<?php }?>">
                        <header class="panel-heading"> 分配奖票权限 </header>
                        <div class="panel-body">
                            <div class="member_role">
                                <div class="icheck" style="display:inline-block;">
                                    <div class="square-red">
                                        <input  type="radio" name="tiketnum" value="0" <?php if($info['tiketnum']==0){echo 'checked';} ?> />
                                        <label>有权限</label>
                                    </div>
                                    <div class="square-red">
                                        <input  type="radio" name="tiketnum" value="-1" <?php if($info['tiketnum']==-1){echo 'checked';} ?> />
                                        <label>无权限</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</form>
<script>
	function listlist(){
		<if condition='$hiddenpos'>
			var hiddenpos = $('{$hiddenpos}');
			hiddenpos.find('.close').each(function(index,element){
				$(this).click(function(e) {
					$(this).parent().remove();
					$('.editselect').trigger("blur");
					e.stopPropagation();
				});
			});
			hiddenpos.find('.close').removeClass('close');
			$('.mypart').html(hiddenpos);
		</if>
		$('.editselect').blur(function(){
			$("#member_position input[name='member_position_id']").remove();
			$('.editselect.binded .itemspan').each(function(){
				$('#member_position').append("<input type='hidden' name='member_position_id' value='"+$(this).children("input:eq(1)").attr('value')+"'>");
			});
		});
	}
	
	//选择员工
function memberListLoaded(){ 
    $('.selectitem').click(function(){
        if($(this).prev('em').length==0){
            $(this).find('input').eq(1).attr('name','pid');
        }
    });
    $('.formMemberSelect').blur(function(){
		$(this).find('input[name="_pid"]').attr('name','pid');
	});
}
</script>
<script>
$('input[name="isadministrator"]').each(function(index, element) {
    $(this).change(function(e) {
        if($(this).val() == 1){
			$('.member_role').addClass('hidden');
		}else{
			$('.member_role').removeClass('hidden');
		}
    });
});
    jQuery(document).ready(function() {
        //格式化详细信息表
        $("#thisrow input[type='radio']").each(function(index, element) {
            if($(this).attr('checked')=='checked'){
                var val = $(this).val();
                $(this).parent('label').attr('style','font-weight:normal');
                $(this).parent('label').removeClass('radio');
                $(this).next('span').remove();
                $(this).replaceWith('<span style="color:#8d8d8d;">'+val+'</span>');
            }else{
                var val='';
                $(this).parent().remove();
                $(this).replaceWith('<span style="color:#8d8d8d;">'+val+'</span>');
            }
        });

        $('#thisrow .form-control ').each(function(index, element) {
            var hidden = $('.hidden').val();
            $('.hidden').replaceWith('');
            var val = $(this).val();
            $(this).replaceWith('<span style="color:#8d8d8d;">'+val+'</span>');
        });
        $('#thisrow td').css({height:'30px',lineHeight:'30px'});
        function checkbox(){
            //表单修改后将之写入隐藏input
            $("#thisrow input[type='checkbox']").each(function(){
                $(this).click(function(){
                    if($(this).attr('checked')=='checked'){
                        $(this).attr('checked','checked');
                    }else {
                        $(this).removeAttr('checked');
                    }
                    $('#newform').val($('#thisrow').html());
                });
            });
            $("#thisrow input[type='radio']").each(function(){
                $(this).click(function(){
                    if($(this).attr('checked')=='checked'){
                        $(this).attr('checked','checked');
                    }else {
                        $(this).removeAttr('checked');
                    }
                    $('#newform').val($('#thisrow').html());
                })
            });
        }
	 	$(window).trigger('load');
    });
//(既不是管理员 又不是 积分专员) 并且 (这个人已经离职 或者 不是我的下属) (a and b) and (c or d)
<if condition='($isadmin neq 1 and $isIntMng neq 1 ) and ( $status eq 0 or $mybelonging eq 0 ) '>
    $('#editbtn').removeAttr('onClick');
    $('.checkoutform input').attr('disabled','disabled');
    $('.checkoutform select').attr('disabled','disabled');
    $('.aui_buttons button').attr('disabled','disabled');
</if>
</script>